package com.example.springboothelloworldquick.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/*@ResponseBody
@Controller*/
@RestController //类的所有方法返回数据提交给浏览器，（如果是对象转为json数据）
public class HelloController {

    @RequestMapping("/hello")
    public String hello() {
        return "你好鸭宝宝";
    }

    /*@Value("${person.last-name}")
    private String name;

    @RequestMapping("/sayHello")
    public String sayHello() {
        return "Hello " + name;
    }*/
}
